Conversation
amotl
commented
Feb 10, 2026
src/crate/client/cursor.py
Outdated
| raise ProgrammingError("Cursor closed") | ||
|
|
||
| __next__ = next | ||
| __next__ = next # noqa: A003 |
Member
Author
There was a problem hiding this comment.
Without that marker, ruff 0.15.0 would complain like this:
A003 Python builtin is shadowed by method `next` from line 181
--> src/crate/client/cursor.py:196:16
|
194 | raise ProgrammingError("Cursor closed")
195 |
196 | __next__ = next
| ^^^^
197 |
198 | @property
|
Found 1 error.
Member
Author
There was a problem hiding this comment.
Would you suggest a different mitigation than just suppressing the warning?
amotl
commented
Feb 10, 2026
src/crate/client/cursor.py
Outdated
| raise ProgrammingError("Cursor closed") | ||
|
|
||
| __next__ = next | ||
| __next__ = next # noqa: A003 |
Member
Author
There was a problem hiding this comment.
Is it the right choice to use builtins.next?
Suggested change
| __next__ = next # noqa: A003 | |
| __next__ = builtins.next |
Member
There was a problem hiding this comment.
Judging from 1d7573e the intention here is to implement the iterator protocol
So why not:
diff --git a/src/crate/client/cursor.py b/src/crate/client/cursor.py
index 587f149..b7aac08 100644
--- a/src/crate/client/cursor.py
+++ b/src/crate/client/cursor.py
@@ -191,11 +191,12 @@ def next(self):
if not self._closed:
return next(self.rows)
else:
raise ProgrammingError("Cursor closed")
- __next__ = next
+ def __next__(self):
+ return self.next()
@property
def description(self):
"""
This read-only attribute is a sequence of 7-item sequences.
Member
Author
There was a problem hiding this comment.
I've updated the patch according to your suggestion. Thank you very much.
mfussenegger
approved these changes
Feb 11, 2026
Member
mfussenegger
left a comment
There was a problem hiding this comment.
See comment regarding the next - otherwise lgtm
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
This unrelated patch just failed CI because the ruff linter complained.
3.14t) #773Thoughts
I don't know why the CI run on that update by Dependabot succeeded.I think the CI run on that update by Dependabot didn't run yesterday, because it was submitted at a time when GitHub had outages across the board.